#include "volumecontrol.h"
#include "../common/cg_common.h"
#include <cmath>
#include <QImage>
#include <QGLWidget>
#include "fileaccesser.h"

#ifndef MAIN_H
#define MAIN_H

VolumeControl* ctrl;
GLuint* textures;
FileAccesser* fileAccesser;

const GLuint TEXTURE_DIRT = 0;
const GLuint TEXTURE_GRASS_TOP = 1;
const GLuint TEXTURE_GRASS_SIDE = 2;
const GLuint TEXTURE_STONE = 3;
const GLuint TEXTURE_WOODPLANK = 4;
const GLuint TEXTURE_STONESLAB_SIDE = 5;
const GLuint TEXTURE_STONESLAB_TOP_BOTTOM = 6;
const GLuint TEXTURE_BRICK = 7;
const GLuint TEXTURE_COBBLESTONE = 8;
const GLuint TEXTURE_BEDROCK = 9;
const GLuint TEXTURE_SAND = 10;
const GLuint TEXTURE_GRAVEL = 11;
const GLuint TEXTURE_WOOD_SIDE = 12;
const GLuint TEXTURE_WOOD_TOP_BOTTOM = 13;
const GLuint TEXTURE_IRONBLOCK = 14;
const GLuint TEXTURE_GOLDBLOCK = 15;
const GLuint TEXTURE_DIAMONDBLOCK = 16;
const GLuint TEXTURE_OBSIDIAN = 17;

float hudScale = 2.0;
bool mouseLeftDown, mouseMiddleDown, mouseRightDown;
bool onlyVolume = false;

QImage hudFrameImage;
QImage hudSelectedImage;

void drawVolume();
void drawBlock(Block block);
void drawTexturedCube(GLfloat size, GLuint tex);
void drawTexturedCube(GLfloat size,
                      GLuint topTex, GLuint sideTex, GLuint bottomTex);
void drawTexturedCube(GLfloat size,
                      GLuint topTex, GLuint bottomTex,
                      GLuint rightTex, GLuint leftTex,
                      GLuint frontTex, GLuint backTex);

#endif // MAIN_H
